%%%%%%%%%%%%%%%%%%%%%
%Preamble
%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{article}
\usepackage[margin=0.9in]{geometry}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}
\usepackage[labelsep=newline]{caption}
\usepackage[flushleft]{threeparttable}
\usepackage{dcolumn}
\usepackage{multirow}
\usepackage{pdfpages}
\usepackage{bbm}

%\ollowdisplaybreaks
\newcolumntype{d}[1]{D{.}{.}{#1}}
\DeclareMathOperator*{\Max}{Max\;}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\newcommand\fnote[1]{\captionsetup{font=footnotesize,justification=justified,singlelinecheck=false}\caption*{#1}}
	\renewcommand\theContinuedFloat{.\alph{ContinuedFloat}}
	\let\oldtabular\tabular
	\renewcommand{\tabular}{\footnotesize\oldtabular}
	\newcommand\fignote[1]{\captionsetup{font=normalsize,justification=justified,singlelinecheck=false}\caption*{\fontsize{7pt}{8pt}\selectfont #1}}
	\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}

%%%%%%%%%%%%%%%%%%%%%
%Command to smoothly run threeparttable
%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand*\ExpandableInput[1]{\@@input#1 }
\def\@biblabel#1{\hspace*{-\labelsep}}
\makeatother

\begin{document}
\begin{table}[p]
\begin{center}
	\caption{Number of Marginable Stocks by Vintage}
\input{../esttab/tab1.tex}
\end{center}
\end{table}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table 2:  Event Study
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vfill
\begin{table}[p]	
\centering
\resizebox{.9\textwidth}{!}{
\begin{threeparttable} 
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} 	
	\caption{Event Study of Marginability} 
	\label{tab:event_study} 
\begin{tabular}{l*{7}{D{.}{.}{1.3}}}
\toprule
&\multicolumn{7}{c}{Panel A: Cumulative Returns Before and After the Introduction of Margin Lending}\\
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}  
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}  
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}\\
&\multicolumn{3}{c}{Following Marginability} &\multicolumn{3}{c}{Preceding Marginability} &\multicolumn{1}{c}{Before vs. After}\\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-8}
&\multicolumn{1}{c}{0 to 1} &\multicolumn{1}{c}{0 to 3} &\multicolumn{1}{c}{ 0 to 12} 
&\multicolumn{1}{c}{-1 to 0} &\multicolumn{1}{c}{-3 to 0} &\multicolumn{1}{c}{-12  to 0} 	 
&\multicolumn{1}{c}{-12 to 12}\\	 		
	\ExpandableInput{../esttab/event_study}	
\midrule   
\noalign{\vskip 2mm} 
&\multicolumn{7}{c}{Panel B: Placebo Estimates} \\
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} 
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}  
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}  
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}}\\
&\multicolumn{3}{c}{Following Marginability} &\multicolumn{3}{c}{Preceding Marginability} &\multicolumn{1}{c}{Before vs. After}\\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-8}
&\multicolumn{1}{c}{0 to 1} &\multicolumn{1}{c}{0 to 3} &\multicolumn{1}{c}{ 0 to 12} 
&\multicolumn{1}{c}{-1 to 0} &\multicolumn{1}{c}{-3 to 0} &\multicolumn{1}{c}{-12  to 0} 	 
&\multicolumn{1}{c}{-12 to 12}\\	 		
\midrule
        Marginable & \multicolumn{1}{c}{-0.001} & \multicolumn{1}{c}{-0.002} & \multicolumn{1}{c}{-0.011} & \multicolumn{1}{c}{0.003} & \multicolumn{1}{c}{0.014} & \multicolumn{1}{c}{0.049} & \multicolumn{1}{c}{0.038} \\
    \relax
    & \multicolumn{1}{c}{[-0.013, 0.012]} & \multicolumn{1}{c}{[-0.023, 0.022]} & \multicolumn{1}{c}{[-0.053, 0.024]} & \multicolumn{1}{c}{[-0.008, 0.015]} & \multicolumn{1}{c}{[-0.014, 0.042]} & \multicolumn{1}{c}{[-0.024, 0.12]} & \multicolumn{1}{c}{[-0.058, 0.129]} \\
\bottomrule	
\end{tabular}
\begin{tablenotes} 
 \item
\end{tablenotes}
\end{threeparttable}}
\end{table}
\vfill
\clearpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table 3:  RD Analysis.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[p]
\centering
\resizebox{.9\textwidth}{!}{
\begin{threeparttable} 
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} 	
\caption{The Impact of Margin Debt -- Regression Discontinuity Evidence}	
\label{rd_tab_margin} 
\begin{tabular}{l*{6}{D{.}{.}{1.3}}}
\toprule
&\multicolumn{6}{c}{Panel A: Crossing Marginability Threshold Predicts Margin Debt}\\ \\
&\multicolumn{3}{c}{Optimal Bandwidth} 	&\multicolumn{3}{c}{Fixed Bandwidth}\\
\cmidrule(lr){2-4}  	\cmidrule(lr){5-7}
&\multicolumn{1}{c}{Marginable} &\multicolumn{1}{c}{Margin} &\multicolumn{1}{c}{$\frac{\text{Margin}}{\text{{Market Cap}}}$}  
&\multicolumn{1}{c}{Marginable} &\multicolumn{1}{c}{Margin} &\multicolumn{1}{c}{$\frac{\text{Margin}}{\text{{Market Cap}}}$} \\	
	\ExpandableInput{../esttab/tab3_a}
\midrule
&\multicolumn{6}{c}{Panel B: Positive Returns to Crossing Threshold -- Reduced Form}\\ \\
&\multicolumn{3}{c}{Optimal Bandwidth} 	&\multicolumn{3}{c}{Fixed Bandwidth}\\
\cmidrule(lr){2-4}  	\cmidrule(lr){5-7}
&\multicolumn{1}{c}{5 Days} &\multicolumn{1}{c}{20 Days} &\multicolumn{1}{c}{60 Days} 
&\multicolumn{1}{c}{5 Days} &\multicolumn{1}{c}{20 Days} &\multicolumn{1}{c}{60 Days}\\	
	\ExpandableInput{../esttab/tab3_b}
\midrule
&\multicolumn{6}{c}{Panel C: Positive Returns to Marginability -- Fuzzy RD}\\ \\
&\multicolumn{3}{c}{Optimal Bandwidth} 	&\multicolumn{3}{c}{Fixed Bandwidth}\\
\cmidrule(lr){2-4}  	\cmidrule(lr){5-7}
&\multicolumn{1}{c}{5 Days} &\multicolumn{1}{c}{20 Days} &\multicolumn{1}{c}{60 Days} 
&\multicolumn{1}{c}{5 Days} &\multicolumn{1}{c}{20 Days} &\multicolumn{1}{c}{60 Days}\\	
	\ExpandableInput{../esttab/tab3_c}	
\bottomrule 
\end{tabular}
\begin{tablenotes} 
\item\scriptsize 
\end{tablenotes}
\end{threeparttable}}
\end{table}
\clearpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table 4:  Mutual Fund Portfolio Weights - Before
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[p]
   \centering
     \caption{Mutual Fund Portfolio Weights: \\ Anticipatory Buying and Post-Marginability Selling}
	\ExpandableInput{../esttab/tab4}	

\end{table}
\clearpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table 5:  Returns for Marginable Portfolios
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[p]
   \caption{Returns for To-Be-Marginable (TBM) portfolios}
      \label{tab:tbm}
\bigskip
     \centering
   \resizebox{1\textwidth}{!}{
   	\begin{threeparttable} 
		\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} 	
\begin{tabular}{l*{13}{c}}
\toprule

    & \multicolumn{3}{c}{Raw Return (\%)}&\multicolumn{3}{c}{Mkt-adj. Return (\%)}&\multicolumn{3}{c}{CAPM Alpha (\%)} &\multicolumn{3}{c}{DGTW Return (\%)}\\
    %\cmidrule(l){3-5}   \cmidrule(l){6-8} \cmidrule(l){9-11} \cmidrule(l){12-14}
        &\multicolumn{1}{c}{TBM}&\multicolumn{1}{c}{NTBM}&\multicolumn{1}{c}{L-S}&\multicolumn{1}{c}{TBM}&\multicolumn{1}{c}{NTBM}&\multicolumn{1}{c}{L-S}&\multicolumn{1}{c}{TBM}&\multicolumn{1}{c}{NTBM}&\multicolumn{1}{c}{L-S}&\multicolumn{1}{c}{TBM}&\multicolumn{1}{c}{NTBM}&\multicolumn{1}{c}{L-S}\\
\hline

\ExpandableInput{../esttab/tab5_a} \\
\ExpandableInput{../esttab/tab5_b} \\

\bottomrule
\end{tabular}
\begin{tablenotes} 
		 \item
	\end{tablenotes}
\end{threeparttable}
}
\end{table}

\clearpage



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Table 7: Model Estimates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[p]
\centering
\captionsetup{justification=centering}
\resizebox{\textwidth}{!}{
\begin{threeparttable}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} 	
\caption{Information Revelation Model of Anticipation}
\label{tab:AB_1}
\begin{tabular}{l*{8}{D{.}{.}{1.3}}}
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} 
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} 
&\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} &\multicolumn{1}{c}{\textcolor{white}{XXXXXX}} \\
\toprule
&\multicolumn{4}{c}{Non-Linear Estimation}
&\multicolumn{4}{c}{Linear Estimation} \\
&\multicolumn{2}{c}{Excess $\Delta$ Price}
&\multicolumn{2}{c}{TWFE} 
&\multicolumn{2}{c}{OLS} 
&\multicolumn{2}{c}{2SLS} \\
\cmidrule(lr){2-3} 			\cmidrule(lr){4-5} 			\cmidrule(lr){6-7} \cmidrule(lr){8-9}   
&\multicolumn{1}{c}{Base} &\multicolumn{1}{c}{Full} &\multicolumn{1}{c}{Base} &\multicolumn{1}{c}{Full}  	 
&\multicolumn{1}{c}{Base} &\multicolumn{1}{c}{Full} &\multicolumn{1}{c}{Base} &\multicolumn{1}{c}{Full} \\
\ExpandableInput{../esttab/tab6}				
\midrule				
\addlinespace
Month $\times$ Year Fixed Effects  
&\multicolumn{1}{c}{No}    &\multicolumn{1}{c}{No} 		&\multicolumn{1}{c}{Yes} 		&\multicolumn{1}{c}{Yes}         
&\multicolumn{1}{c}{Yes}   &\multicolumn{1}{c}{Yes}        	&\multicolumn{1}{c}{Yes}           &\multicolumn{1}{c}{Yes} \\
\addlinespace
Stock Fixed Effects    &\multicolumn{1}{c}{No}    &\multicolumn{1}{c}{No}          &\multicolumn{1}{c}{Yes}         &\multicolumn{1}{c}{Yes}         
				 &\multicolumn{1}{c}{Yes}   &\multicolumn{1}{c}{Yes}         &\multicolumn{1}{c}{Yes}         &\multicolumn{1}{c}{Yes}     \\
\bottomrule
\end{tabular}
\begin{tablenotes} 
 \item\scriptsize 
\end{tablenotes}
\end{threeparttable}}
\end{table}
\clearpage


\vfill
\input{../esttab/Tab7_a}
\vfill
\clearpage

\begin{table}[p]
\centering
\caption{Table 7 - Panel B: Margin Debt and the Bust \label{auxfig:mdb}}
{\begin{threeparttable} 
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{lccc}    
\toprule    
\ExpandableInput{../esttab/tab7_b}				
\bottomrule
\end{tabular}
\begin{tablenotes} 
\item\scriptsize 
\end{tablenotes}
\end{threeparttable}}
\end{table}



\clearpage

\end{document}
